<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta name="renderer" content="webkit" />
		<meta http-equiv="Pragma" content="no-store" />
		<meta http-equiv="Access-Control-Allow-Origin" content="*">
		<title>矿车</title>
		
		<link rel="stylesheet" href="../../css/retrieve/iconfont.css">
		<link rel="stylesheet" href="../../css/bootstrap.min.css">
		<link rel="stylesheet" href="../../css/retrieve/swiper.min.css">
		<link rel="stylesheet" href="../../css/layer.css">
		<script type="text/javascript" src="../../js/layer.js"></script>
		<script type="text/javascript" src="../../js/jquery-2.2.3.min.js"></script>
		<script type="text/javascript" src="../../js/itnetcao.js"></script>
		<script type="text/javascript" src="../../js/swiper.min.js"></script>
		
		<style type="text/css">
			body{
				background-color: rgb(242, 242, 242);
			}
			#kj_header {
				height: 60px;
				background-color: rgb(255, 198, 17);
        		text-align: center;
        		font-size: 21px;
        		line-height: 60px;
			}

			#kj_wkl {
				height: 60px;
				padding-top: 10px;
				background-color: #fff;
			}
			#kj_wkl span{
				font-size: 21px;
			}
			#efficiency{
				width: 100px;
				height: 40px;
				border-radius:10px;
				-webkit-border-radius:10px;
				text-align: center;
				border: 1px solid rgb(255, 198, 17);
				background-color: rgb(255, 198, 17);
				position: relative;
				font-size: 19px;
				color: #fff;
			}
			.swiper-container {
				height: 50%;
				padding-top: 15px;

			}
			.swiper-slide {
				text-align: center;
				font-size: 18px;
				background: #fff;
				/* Center slide text vertically */
				display: -webkit-box;
				display: -ms-flexbox;
				display: -webkit-flex;
				display: flex;
				-webkit-box-pack: center;
				-ms-flex-pack: center;
				-webkit-justify-content: center;
				justify-content: center;
				-webkit-box-align: center;
				-ms-flex-align: center;
				-webkit-align-items: center;
				align-items: center;
				background-color: rgb(242, 242, 242);
			}


			.miner{
				width:240px;
				height: 330px;
				border-radius: 8px;
				background-color: #fff;
			}
			.miner_img{
		        width: 140px;
		        height: 140px;
		      }
		      .miner_img img{
		        width: 100%;
		        height: 100%;
		      }
		      .p1{
		        font-size:16px;
		        font-weight:bold;
		        text-align:center;
		        margin-top:10px;
		      }
		      .p2{
		        font-size:16px;
		        text-align:center;
		        margin-top:5px;
		        color:rgb(108, 108, 108);
		      }
		      .p3{
		        font-size:16px;
		        font-weight:bold;
		        margin-top:5px;
				margin-bottom: 1px;
		      }
			.but_purchase{
				width: 50%;
				height: 30px;
				float: left;
				border: none;
				font-size: 16px;
				font-weight:bold;
				text-align:center;
				outline:none;
			}
			.xts_purchase{
				background-color: orange;
				border-radius: 0 0 0 8px;
			}
			.yg_purchase{
				background-color: rgb(255, 198, 17);
				border-radius: 0 0 8px 0;
			}
		</style>
	</head>

	<body>

		<div id="kj_header">
			矿机
		</div>
		<div id="kj_wkl" align="center">
			<span>当前挖矿率</span>
      		<input type="text" id="efficiency" value="0" readonly="readonly"/>
		</div>
		<div style='width:100%;position:absolute;overflow:hidden;'>
		<!-- Swiper -->
			<div class="swiper-container" style='margin-top:10%;'>
				<div class="swiper-wrapper">
					
					<div class="swiper-slide">
						<div class="miner" align="center">
							<div class="miner_img"><img src="../../image/weixing.jpg"/></div>
							<p class="p1">微型矿机</p>
							<p class="p2">XTL开采率：0.01-0.012</p>
							<p class="p2">24小时产量：0.44-0.4466</p>
							<p class="p2">矿机周期:600小时</p>
							<p class="p3">价格：<span class="money">10.0</span></p>
							<input type="button" value="XTS购买" name="1_10" class="but_purchase xts_purchase"  onclick="buyXTS('0', '1', '0.01-0.012', '0.4466', '600', '10.0', '微型')"/>
							<input type="button" value="银果购买" name="1_10" class="but_purchase yg_purchase" onclick="buyXTS('1', '1', '0.01-0.012', '0.4466', '600', '10.0', '微型')"/>
						</div>
					</div>
					
					<div class="swiper-slide">
						<div class="miner" align="center">
					        <div class="miner_img"><img src="../../image/chuji.jpg"/></div>
					        <p class="p1">初级矿机</p>
					        <p class="p2">XTL开采率：0.1-0.12</p>
					        <p class="p2">24小时产量：4.8-4.912</p>
					        <p class="p2">矿机周期:600小时</p>
					        <p class="p3">价格：<span class="money">100.0</span></p>
							<p>
								<input type="button" value="XTS购买" name="2_100" class="but_purchase xts_purchase" onclick="buyXTS('0', '2', '0.1-0.12', '4.912', '600', '100.0', '初级')"/>
								<input type="button" value="银果购买" name="2_100" class="but_purchase yg_purchase" onclick="buyXTS('1', '2', '0.1-0.12', '4.912', '600', '100.0', '初级')"/>
							</p>
			      		</div>
					</div>
					
					<div class="swiper-slide">
						<div class="miner" align="center">
					        <div class="miner_img"><img src="../../image/zhongji.jpg"/></div>
					        <p class="p1">中级矿机</p>
					        <p class="p2">XTL开采率：1-1.2</p>
					        <p class="p2">24小时产量：52-53</p>
					        <p class="p2">矿机周期:600小时</p>
					        <p class="p3">价格：<span class="money">1000.0</span></p>
							<p>
								<input type="button" value="XTS购买" name="3_1000" class="but_purchase xts_purchase" onclick="buyXTS('0', '3', '1-1.2', '53.0', '600', '1000.0', '中级')"/>
								<input type="button" value="银果购买" name="3_1000" class="but_purchase yg_purchase" onclick="buyXTS('1', '3', '1-1.2', '53.0', '600', '1000.0', '中级')"/>
							</p>
			      		</div>
					</div>
	
					<div class="swiper-slide">
						<div class="miner" align="center">
					        <div class="miner_img"><img src="../../image/gaoji.jpg"/></div>
					        <p class="p1">高级矿机</p>
					        <p class="p2">XTL开采率：10-13</p>
					        <p class="p2">24小时产量：560-575</p>
					        <p class="p2">矿机周期:600小时</p>
					        <p class="p3">价格：<span class="money">10000.0</span></p>
							<input type="button" value="XTS购买" name="4_10000" class="but_purchase xts_purchase" onclick="buyXTS('0', '4', '10-13', '575.0', '600', '10000.0', '高级')"/>
							<input type="button" value="银果购买" name="4_10000" class="but_purchase yg_purchase" onclick="buyXTS('1', '4', '10-13', '575.0', '600', '10000.0', '高级')"/>
			      		</div>
					</div>
	
				</div>
			</div>
		</div>
		<script type='text/javascript'>
		var userId = jQuery.parseJSON(localStorage.getItem("miningmachine_user")).userId;
		$("body").css({"width" : $(window).width() + "px !important"});
		$("#kj_header").css({"width" : $(window).width() + "px !important"});
		$("#kj_wkl").css({"width" : $(window).width() + "px !important"});
		$(".swiper-container").css({"width" : $(window).width() + "px !important"});
		$(function() {
			
			var url = localStorage.getItem("url") + "/dug/controller/DugMoneyFindAllAPP.do";
			var data = "userId=" + userId;
			itcao.itGetAjaxBigData(url, data).done(function(result) {
				var json = jQuery.parseJSON(result);
				if(json.state == true) {
					for(var i=0; i<json.bean.length; i++) {
						if(json.bean[i].dugIsStart == 1) {
							if(json.bean.length > 0) {
								setInterval(function() {
									var m = parseFloat(Math.random() * (Math.random()*5) * 100 / 1000000).toFixed(5);
									$("#efficiency").val(m);
								}, 1000)
								break;
							}
						}
					}
				}
			})
		})
		//xts购买
		function buyXTS(goumaifangshi, type, xtl, kaicailv, zhouqi, jiage, text){
			layer.open({
				anim: 'up',
				content: '是否花费'+ jiage + (goumaifangshi == 0 ? 'XTS' : '银果')+'购买'+text+'矿机？',
				btn: ['确认', '取消'],
				yes: function(index){
					layer.close(index);
					var url = localStorage.getItem("url") + "/dug/controller/DugMoneySaveAPP.do";
					var data = "dugType=" + type + "&dugMuchCurrency=" + kaicailv + "&dugCycle=" + zhouqi + "&dugMiningRate=" + xtl + "&dugPrice=" + jiage
					+ "&dugUserId=" + jQuery.parseJSON(localStorage.getItem("miningmachine_user")).userId + "&type=" + goumaifangshi;
					itcao.itGetAjaxBigData(url, data).done(function(result) {
						var json = jQuery.parseJSON(result);
						if(json.state == true) {
							alert("购买成功.");
							window.location.href = "miner.html";
						}else {
							alert(json.value);
						}
					})
				}
			});
		}
		var swiper = new Swiper('.swiper-container');
		</script>
	</body>

</html>
